<?php
include 'headerN.php';
include 'conexaoMysql.php';

$crud = new crud();
$eventos = $crud->consultaLivre("select tbEventoId, tbEventoTema from tbEvento order by tbEventoTema");
?>

<div class="edicao">
    Lista de Presença
</div>

Selecione o Evento<br>

<select class="input" id="comboEvento" size=1 name=eventoCombo onChange=vai(this)>
    <option value="0">Selecione o Evento</option>
<?php while ($ev = mysql_fetch_array($eventos)) { ?>
        <option value=<?php echo $ev[0] ?>><?php echo "$ev[0] - $ev[1]" ?></option>
    <?php } ?>
</select>


<div id="dados">


</div>

<?php include 'footerN.php'; ?>

<script type="text/javascript">

    function vai(combo){
        var id = combo.options[combo.selectedIndex].value;
        //var y = combo.options[combo.selectedIndex].text;
        //alert(id);
        //location.href='sessao.php?evento='+x+'&link=inscricoes';  
        $("#dados").load('frequenciaModel.php', {'dados[]':[2 , id]});
    }     
                                                   
                                                   
</script>